  <x-layout>

    <div class="container b542">
      <div class="row mt-4">
        <div class="col">
          <div class="control-bg text-center p-3">
            <!-- <img src="./img1/24H.png" class="d-block mx-auto c-img" alt=""> -->
            <div><span id="c-hour" class="c-span"></span> <span id="c-num" class="c-span"></span></div>
            <span class="d-block pt-2 c-time fw-light" id="c-time"></span>
          </div>
        </div>
      </div>
      <div class="row mt-4">
        <div class="col ">
          <div class="singal-bg p-4">


            <!-- 风控值 -->
            <div class="singal-box text-center clearfix " id="c-lp">
              <span class="s1 "></span>
              <span class="s2 "></span>
              <span class="s3 "></span>
              <span class="s4 "></span>
              <span class="s5 "></span>
              <span class="s6"></span>
              <span class="s7"></span>
              <span class="s8"></span>
              <span class="s9"></span>
              <span class="s10"></span>
            </div>

            <div class="singal-text text-center mt-1 mb-1 fw-light" id='c-lp-val'>风控值：60%</div>
            <div class="singal-tips mt-1 fw-light">(备注:初始值为蓝色,50%,上调为绿色,下调为红色)</div>
          </div>
        </div>
      </div>

      <div class="row mt-4">
        <!-- 矿池进度 -->
        <div class="col ">
          <div class="singal-bg pt-3 pb-3">

            <!-- 风控值 -->
            <div class="pool-box clearfix " id="c-lp-destroy">
              <span class="active"></span>
              <span class="active"></span>
              <span class="active"></span>
              <span class="active"></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
              <span class></span>
            </div>

            <div class="d-flex bd-highlight mb-3" style="width: 259px;margin: auto;">
              <div class="me-auto bd-highlight text-white fw-light">销毁矿池: <span id="c-lp-destroy1">0%</span> </div>
              <div class="bd-highlight text-white fw-light">LP矿池: <span id="c-lp1">0%</span> </div>
            </div>

            <div class="singal-tips py-1 px-4 fw-light">(备注:销毁矿池与LP矿池产出用两种不同颜色呈现，在更改参数时，颜色对应比例变化)</div>

          </div>
        </div>
      </div>

      <!-- tailwindcss -->

    </div>

  </x-layout>
  <!--partner-->

  <script>
    $(function() {

      token = mgToken()

      //获取邀请信息
      axios.post(mgRoute.control, {}, {
        headers: {
          token: token
        }
      }).then((r) => {
        var d = r.data
        if (d.status == 200) {
          j = d.data
          // dlog(j)

          $("#c-hour").text(j.hour)
          $("#c-num").text(j.dayUpNumber)
          $("#c-time").text(j.time)
          $("#c-lp-val").text(j.controlCoefficient)

          $("#c-lp1").text(j.lp)
          $("#c-lp-destroy1").text(j.destroy)

          //风控条
          var jc = Math.ceil(parseFloat(j.controlCoefficient) / 10)
          var jcSpan = '';
          var color = "blue";
          if (jc < 5) {
            color = 'red';
          } else if (jc > 5) {
            color = 'green';
          }
          for (var i = 1; i <= 10; i++) {
            jcSpan += ' <span class="s' + i;
            if (i <= jc) {
              jcSpan += ' ' + color + '"></span>';
            } else {
              jcSpan += '"></span>';
            }
          }
          $("#c-lp").html(jcSpan)

          //进度条
          var jdSpan = '',
            jd = Math.floor(parseFloat(j.destroy) / 3.125)
          for (var i = 1; i <= 32; i++) {
            jdSpan += ' <span class="' + i;
            if (i <= jd) {
              jdSpan += ' active"></span>';
            } else {
              jdSpan += '"></span>';
            }
          }
          $("#c-lp-destroy").html(jdSpan)

        } else {
          // alert("请求失败")
        }
      }).catch((e) => {
        dlog(e)
      })


    })
  </script>